<{lang_script src="lang.js" app="site"}>
<{css src="framework.css" app="site" pdir="css_mini"}>
<{css src="b2c.css" app="b2c" pdir="css_mini"}>
<{css src="passport.css" app="b2c" pdir="css_mini"}>
<{if defined("DEBUG_JS") && DEBUG_JS}>
  <{script src="mootools.js" app="site"}>
  <{script src="formplus.js" app="site"}>
  <{script src="jstools.js" app="site"}>
  <{script src="shoptools.js" app="b2c"}>
  <{script src="coms/popup.js" app="site"}>
<{else}>
  <{script src="moo_min.js" app="site" pdir="js_mini"}>
  <{script src="tools_min.js" app="site" pdir="js_mini"}>
  <{script src="shoptools_min.js" app="b2c" pdir="js_mini"}>
  <{script src="ui_min.js" app="site" pdir="js_mini"}>
<{/if}>
<{css src="ecmall.css" app="business"}>
<{css src="style.css" app="business"}>
<{script src="dialog.js" app="business" pdir="js"}>
<{script src="modedialog.js" app="business" pdir="js"}>
<{script src="load.js" app="business" pdir="js"}>
<{script src="wpage.js" app="business" pdir="js"}>
<{lang_script src="lang.js" app="b2c"}>
<{lang_css src="lang.css" app="b2c"}>
<form id="brand" action="<{link app=business ctl=site_brand act=save}>"  method="POST" enctype="multipart/form-data">
     <{input type="hidden" name="edit" value=$edit}>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
	  <th><{t}>品牌名称：<{/t}></th>
	  <td>
	  <{if !$edit}><{input type="text" name="brand_name" id="brand_name" style="width:120px" required="true" value=$brand_name onblur="nameCheck(this);"}><span id="check"></span>
	  <{else}>
       <input type="text" name="brand_name" id="brand_name" style="width:120px" required="true" value=<{$brand_name}>
	   readonly="readonly" onchange="nameCheck(this);" ><span id="check"></span>
	  <{/if}>
	  </td>
	</tr>
	<!--添加经营范围-->
	 <tr>
		<th><{t}>所属分类: <{/t}></th>
		<td>
			<{input type="select" name="store_cat" options=$storeregion value=$shopinfo.store_region  required="true"  }>
		</td>
		<td></td>
	</tr>
	<!--经营范围-->

	<tr>
	  <th><{t}>网址：<{/t}></th>
	  <td><{input type="text" name="brand_url" style="width:120px" value=$brand_url}></td>
	</tr>
	<tr>
	  <th>LOGO：</th>
	  <td>
	  <{input type='vimage' name='brand_logo' width=200 height=100 value=$brand_logo}>
      </td>
	</tr>

	<tr>
	  <th><{t}>详细说明：<{/t}></th>
	  <td><{input type="textarea" name="brand_desc" value='' width='400px' height='200px' value=$brand_desc}></td>
	</tr>
	</table>
	<div style="align:center;">
		<{button type="button" id="btn" label=$___b2c="提交申请"|t:'b2c'}>
	</div>
</form>

<script>

	$('btn').addEvent('click',function(){
		if($('check').innerHTML =='<span class="font-red">&nbsp;该品牌名称已存在！</span>' ||$('check').innerHTML =='<span class="font-red">&nbsp;品牌名称不能为空！</span>' <{if !$edit}>|| $('check').innerHTML ==''<{/if}>){
		  //不提交
		}else{
		   $('brand').submit();
		}

   });

	 function nameCheck(input){

        new Request.HTML({
            url:'<{link app=business ctl=site_brand act=namecheck}>',
            update:$(input).getNext(),
            method:'post',
            data:'brand_name='+encodeURIComponent(input.value.trim())
        }).send();
    }
    
</script>